package com.yeban.javase.day03.test02;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/10/11
 */
public class Test {

    public static void main(String[] args) {

        Employee m = new Manager("王经理",10001,8000,3000);
        System.out.println(m.getName() + "涨薪前工资：" + m.getPay());

        // 优先级：强制类型转换 < 方法调用
        ((Manager)m).addSalary(1000);
        System.out.println(m.getName() + "涨薪后工资：" + m.getPay());
        System.out.println(m.getName() + "分红为:" + ((Manager)m).getBonus());

        System.out.println(m.toString());
    }
}
